#import inportant libraries
import pandas as pd
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
#read the data\
data = pd.read_csv("Downloads/Screentime-App-Details.csv")
print(data.head())
Date Usage Notifications Times opened App 0 08/26/2022 38 70 49 Instagram 1 08/27/2022 39 43 48 Instagram 2 08/28/2022 64 231 55 Instagram 3 08/29/2022 14 35 23 Instagram 4 08/30/2022 3 19 5 Instagram
#Check if dataset has null values
data.isnull().sum()
Date 0 Usage 0 Notifications 0 Times opened 0 App 0 dtype: int64
#Dataset has no null values
#Check the descriptive statistics
print(data.describe())
Usage Notifications Times opened count 54.000000 54.000000 54.000000 mean 65.037037 117.703704 61.481481 std 58.317272 97.017530 43.836635 min 1.000000 8.000000 2.000000 25% 17.500000 25.750000 23.500000 50% 58.500000 99.000000 62.500000 75% 90.500000 188.250000 90.000000 max 244.000000 405.000000 192.000000
#Analyze the screentime of the user
#Will look at the amount of usage of the apps
figure = px.bar(data_frame = data,
x = "Date",
y = "Usage",
color = "App",
title = "Usage")
figure.show()
#Now look at the number of notifications from the apps
figure = px.bar(data_frame = data,
x = "Date",
y = "Notifications",
color = "App",
title = "Notifications")
figure.show()
#Now look at the number of times the apps are opened
figure = px.bar(data_frame = data,
x = "Date",
y = "Times opened",
color = "App",
title = "Times Opened")
figure.show()
#Let's look at the relationship between the number of notifications and the amount of usage
figure = px.scatter(data_frame = data,
x = "Notifications",
y = "Usage",
size = "Notifications",
trendline = "ols",
title = "Relationship between Number of Notifications and Usage")
figure.show()
#There’s a linear relationship between the number of notifications and the amount of usage.
#It means that more notifications result in more use of smartphones.
#Summary
#Screen Time Analysis is the task of analyzing and creating a report on which applications and
#websites are used by the user for how much time.